
input_file = open('input/get_maxid_collection.txt', mode='r', encoding='utf-8')
output_file = open('output/get_maxid_collection.txt', mode='w', encoding='utf-8')

template = 'insert into T_MAXID_COLLECTION select %s, max(id) from %s;'

for line in input_file:
    row = line.rstrip()
    out = template % ("'" + row + "'", row)
    output_file.write(out + '\n')
